# 导包
import json

# 打开文件
with open("data/tpshop.json", "r", encoding="utf-8") as f:
    # 读取文件
    text = json.load(f)
    print(text)


import pytest


class TestJson(object):
    def test01_json(self):
        assert text["msg"] == '登陆成功'

    def test02_json(self):
        assert text["result"]["mobile"] == "13122223333"


if __name__ == '__main__':
    pytest.main(["-s", "hm04_作业题.py"])
